package com.itheima.mapper;

import com.itheima.pojo.Clazz;
import com.itheima.pojo.EmpQueryParam;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ClazzMapper {

    List<Clazz> list(EmpQueryParam empQueryParam);

    @Insert("insert into clazz (name, room, begin_date, end_date, master_id, subject, create_time, update_time) " +
            "values (#{name},#{room},#{beginDate},#{endDate},#{masterId},#{subject},#{createTime},#{updateTime})")
    void insert(Clazz clazz);


    @Select("select * from clazz where id = #{id}")
    Clazz getInfo(Integer id);


    void modify(Clazz clazz);


    @Select("select * from clazz")
    List<Clazz> getAll();


    @Delete("delete from clazz where id = #{id}")
    void delete(Integer id);

    @Select("select count(*) from student where clazz_id = #{id}")
    Integer getCount(Integer id);
}
